package p270jp.pxv.android.advertisement.presentation.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.socdm.p087d.adgeneration.ADG;
import p062c4.ViewBindings;
import p064c6.Preconditions;
import p155fe.AmazonPublisherServicesInitializer;
import p189gn.AbstractC3435a;
import p216hn.Lambda;
import p216hn.Reflection;
import p325m0.MutabilityOwnership;
import p376no.Koin;
import p404oo.AbstractC5475a;
import p579vo.Qualifier;
import p603wm.AbstractC6949c;

/* compiled from: OverlayAdgTamView.kt */
/* renamed from: jp.pxv.android.advertisement.presentation.view.OverlayAdgTamView */
/* loaded from: classes2.dex */
public final class OverlayAdgTamView extends FrameLayout implements AbstractC5475a {

    /* renamed from: a */
    public final AbstractC6949c f18842a = Preconditions.m9802P(1, new C4176a(this, null, null));

    /* renamed from: b */
    public ADG f18843b;

    /* compiled from: KoinComponent.kt */
    /* renamed from: jp.pxv.android.advertisement.presentation.view.OverlayAdgTamView$a */
    /* loaded from: classes2.dex */
    public static final class C4176a extends Lambda implements AbstractC3435a<AmazonPublisherServicesInitializer> {

        /* renamed from: a */
        public final /* synthetic */ AbstractC5475a f18844a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4176a(AbstractC5475a aVar, Qualifier aVar2, AbstractC3435a aVar3) {
            super(0);
            this.f18844a = aVar;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, fe.d] */
        @Override // p189gn.AbstractC3435a
        public final AmazonPublisherServicesInitializer invoke() {
            return this.f18844a.getKoin().f24118a.m920a().m621a(Reflection.m5499a(AmazonPublisherServicesInitializer.class), null, null);
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public OverlayAdgTamView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        MutabilityOwnership.m3745m(context, "context");
        MutabilityOwnership.m3745m(attributeSet, "attributeSet");
    }

    private final AmazonPublisherServicesInitializer getAmazonPublisherServicesInitializer() {
        return (AmazonPublisherServicesInitializer) this.f18842a.getValue();
    }

    @Override // p404oo.AbstractC5475a
    public Koin getKoin() {
        return AbstractC5475a.C5476a.m3211a(this);
    }

    public final void setup(String str) {
        MutabilityOwnership.m3745m(str, "locationId");
        View view = this.f18843b;
        if (view != null) {
            removeView(view);
            ADG adg = this.f18843b;
            if (adg != null) {
                ViewBindings.m9831f(adg);
            }
        }
        ADG adg2 = new ADG(getContext());
        adg2.setReloadWithVisibilityChanged(false);
        adg2.setFillerRetry(false);
        adg2.setAdFrameSize(ADG.AdFrameSize.SP);
        adg2.setAdListener(new p312le.OverlayAdgTamView(adg2));
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 17;
        adg2.setLayoutParams(layoutParams);
        adg2.setLocationId(str);
        this.f18843b = adg2;
        addView(adg2);
        AmazonPublisherServicesInitializer amazonPublisherServicesInitializer = getAmazonPublisherServicesInitializer();
        Context context = getContext();
        MutabilityOwnership.m3746l(context, "context");
        amazonPublisherServicesInitializer.m6315a(context);
    }
}
